# The core loading code in this directory is being transitioned into a separate
# Mojo networking service. See http://crbug.com/598073. The first stage is to
# decouple the code that will be moved from the rest of content. These rules
# help ensure that we don't add more includes, and can progressively reduce the
# code's dependencies.
#
# For each file, the first section shows includes that are allowed (i.e. because
# they are for files that will be moving as well). The second section, separated
# by a comment, lists files that we will have to decouple.
specific_include_rules = {
  "async_resource_handler\.(cc|h)": [
    "-content",
    "+content/browser/loader/async_resource_handler.h",
    "+content/browser/loader/downloaded_temp_file_impl.h",
    "+content/browser/loader/netlog_observer.h",
    "+content/browser/loader/resource_buffer.h",
    "+content/browser/loader/resource_controller.h",
    "+content/browser/loader/resource_dispatcher_host_impl.h",
    "+content/browser/loader/resource_handler.h",
    "+content/browser/loader/resource_message_delegate.h",
    "+content/browser/loader/resource_message_filter.h",
    "+content/browser/loader/resource_request_info_impl.h",
    "+content/browser/loader/upload_progress_tracker.h",
    "+content/common/content_export.h",
    "+content/public/browser/resource_dispatcher_host_delegate.h",
    "+content/public/common/resource_response.h",

    # TODO: these all have to be removed.
    "+content/public/common/content_features.h",

    # TODO: To be replaced by mojo.
    "+content/common/resource_messages.h",
    "+content/common/resource_request_completion_status.h",
    "+content/common/view_messages.h",
  ],
  "async_revalidation_driver\.(cc|h)": [
    "-content",
    "+content/browser/loader/async_revalidation_driver.h",
    "+content/common/content_export.h",
    "+content/public/browser/resource_throttle.h",
  ],
  "async_revalidation_driver_unittest\.cc": [
    "-content",
    "+content/browser/loader/async_revalidation_driver.h",

    # TODO: these all have to be removed.
    # Only one test needs these, so that can stay in content while the other
    # tests move.
    "+content/public/browser/client_certificate_delegate.h",
    "+content/public/common/content_client.h",
    "+content/public/test/test_browser_thread_bundle.h",
    "+content/test/test_content_browser_client.h",
  ],
  "async_revalidation_manager\.(cc|h)": [
    "-content",
    "+content/browser/loader/async_revalidation_driver.h",
    "+content/browser/loader/async_revalidation_manager.h",
    "+content/browser/loader/resource_request_info_impl.h",
    "+content/browser/loader/resource_scheduler.h",
    "+content/public/browser/resource_throttle.h",

    # TODO: To be replaced by mojo.
    "+content/common/resource_messages.h",
    "+content/common/resource_request.h",
  ],
  "downloaded_temp_file_impl\.(cc|h)": [
    "-content",
    "+content/browser/loader/downloaded_temp_file_impl.h",
    "+content/browser/loader/resource_dispatcher_host_impl.h",
    "+content/common/content_export.h",
    "+content/common/url_loader_factory.mojom.h"
  ],
  "resource_buffer.*\.(cc|h)": [
    "-content",
    "+content/browser/loader/resource_buffer.h",
    "+content/common/content_export.h",
  ],
  "global_routing_id\.h": [
    "-content",
  ],
  "layered_resource_handler\.(cc|h)": [
    "-content",
    "+content/browser/loader/layered_resource_handler.h",
    "+content/browser/loader/resource_handler.h",
    "+content/common/content_export.h",
  ],
  "mojo_async_resource_handler\.(cc|h)": [
    "-content",
    "+content/browser/loader/async_resource_handler.h",
    "+content/browser/loader/downloaded_temp_file_impl.h",
    "+content/browser/loader/mojo_async_resource_handler.h",
    "+content/browser/loader/test_url_loader_client.h",
    "+content/browser/loader/netlog_observer.h",
    "+content/browser/loader/resource_controller.h",
    "+content/browser/loader/resource_dispatcher_host_impl.h",
    "+content/browser/loader/resource_handler.h",
    "+content/browser/loader/resource_request_info_impl.h",
    "+content/common/content_export.h",
    "+content/common/resource_request_completion_status.h",
    "+content/public/browser/global_request_id.h",
    "+content/public/browser/resource_dispatcher_host_delegate.h",
    "+content/public/common/resource_response.h",
    "+content/common/url_loader.mojom.h",
  ],
  "mojo_async_resource_handler_unittest\.cc": [
    "-content",
    "+content/browser/loader/mock_resource_loader.h",
    "+content/browser/loader/mojo_async_resource_handler.h",
    "+content/browser/loader/test_url_loader_client.h",
    "+content/browser/loader/resource_controller.h",
    "+content/browser/loader/resource_dispatcher_host_impl.h",
    "+content/browser/loader/resource_request_info_impl.h",
    "+content/common/resource_request.h",
    "+content/common/resource_request_completion_status.h",
    "+content/common/url_loader.mojom.h",
    "+content/public/browser/appcache_service.h",
    "+content/public/browser/navigation_data.h",
    "+content/public/browser/resource_context.h",
    "+content/public/browser/resource_dispatcher_host_delegate.h",
    "+content/public/browser/resource_throttle.h",
    "+content/public/browser/stream_info.h",
    "+content/public/common/previews_state.h",
    "+content/public/common/resource_response.h",
    "+content/public/common/resource_type.h",
    "+content/public/test/test_browser_context.h",
    "+content/public/test/test_browser_thread_bundle.h",
  ],
  "netlog_observer\.(cc|h)": [
    "-content",
    "+content/browser/loader/netlog_observer.h",
    "+content/browser/loader/resource_request_info_impl.h",
    "+content/public/common/resource_response.h",

    # TODO: These all have to be removed.
    "+content/public/browser/browser_thread.h",  # Only for DCHECK.
    "+content/public/common/resource_devtools_info.h",
  ],
  "power_save_block_resource_throttle\.(cc|h)": [
    "-content",
    "+content/browser/loader/power_save_block_resource_throttle.h",
    "+content/public/browser/resource_throttle.h",
  ],
  "resource_dispatcher_host_impl\.(cc|h)": [
    "-content",
    "+content/browser/loader/async_resource_handler.h",
    "+content/browser/loader/async_revalidation_manager.h",
    "+content/browser/loader/global_routing_id.h",
    "+content/browser/loader/loader_delegate.h",
    "+content/browser/loader/mojo_async_resource_handler.h",
    "+content/browser/loader/power_save_block_resource_throttle.h",
    "+content/browser/loader/resource_dispatcher_host_impl.h",
    "+content/browser/loader/resource_loader.h",
    "+content/browser/loader/resource_loader_delegate.h",
    "+content/browser/loader/resource_message_filter.h",
    "+content/browser/loader/resource_request_info_impl.h",
    "+content/browser/loader/resource_requester_info.h",
    "+content/browser/loader/resource_scheduler.h",
    "+content/browser/loader/stream_resource_handler.h",
    "+content/browser/loader/sync_resource_handler.h",
    "+content/browser/loader/throttling_resource_handler.h",
    "+content/common/resource_request_body.h",
    "+content/common/resource_request_body_impl.h",
    "+content/common/url_loader.mojom.h",
    "+content/public/browser/global_request_id.h",
    "+content/public/browser/resource_dispatcher_host.h",
    "+content/public/browser/resource_dispatcher_host_delegate.h",
    "+content/public/browser/resource_request_info.h",
    "+content/public/browser/resource_throttle.h",
    "+content/public/common/previews_state.h",

    # TODO: These all have to be removed.
    "+content/browser/appcache/appcache_interceptor.h",
    "+content/browser/appcache/appcache_navigation_handle_core.h",
    "+content/browser/appcache/chrome_appcache_service.h",
    "+content/browser/bad_message.h",
    "+content/browser/blob_storage/chrome_blob_storage_context.h",
    "+content/browser/child_process_security_policy_impl.h",
    "+content/browser/download/save_types.h",
    "+content/browser/frame_host/frame_tree.h",
    "+content/browser/frame_host/navigation_handle_impl.h",
    "+content/browser/frame_host/navigation_request_info.h",
    "+content/browser/frame_host/navigator.h",
    "+content/browser/loader/cross_site_resource_handler.h",
    "+content/browser/loader/detachable_resource_handler.h",
    "+content/browser/loader/intercepting_resource_handler.h",
    "+content/browser/loader/mime_sniffing_resource_handler.h",
    "+content/browser/loader/navigation_resource_handler.h",
    "+content/browser/loader/navigation_resource_throttle.h",
    "+content/browser/loader/navigation_url_loader_impl_core.h",
    "+content/browser/loader/redirect_to_file_resource_handler.h",
    "+content/browser/loader/upload_data_stream_builder.h",
    "+content/browser/resource_context_impl.h",
    "+content/browser/service_worker/foreign_fetch_request_handler.h",
    "+content/browser/service_worker/link_header_support.h",
    "+content/browser/service_worker/service_worker_context_wrapper.h",
    "+content/browser/service_worker/service_worker_navigation_handle_core.h",
    "+content/browser/service_worker/service_worker_request_handler.h",
    "+content/browser/streams/stream.h",
    "+content/browser/streams/stream_context.h",
    "+content/browser/streams/stream_registry.h",
    "+content/common/content_export.h",
    "+content/common/navigation_params.h",
    "+content/common/net/url_request_service_worker_data.h",
    "+content/common/site_isolation_policy.h",
    "+content/public/browser/browser_thread.h",
    "+content/public/browser/navigation_ui_data.h",
    "+content/public/browser/plugin_service.h",
    "+content/public/browser/resource_request_details.h",
    "+content/public/browser/stream_handle.h",
    "+content/public/browser/stream_info.h",
    "+content/public/browser/web_contents_observer.h",
    "+content/public/common/browser_side_navigation_policy.h",
    "+content/public/common/content_features.h",
    "+content/public/common/content_switches.h",
    "+content/public/common/request_context_type.h",
    "+content/public/common/resource_type.h",

    # TODO: To be replaced by mojo.
    "+content/common/resource_messages.h",
    "+content/common/resource_request.h",
    "+content/common/resource_request_completion_status.h",
    "+content/common/view_messages.h",
  ],
  "resource_handler\.(cc|h)": [
    "-content",
    "+content/browser/loader/resource_handler.h",
    "+content/browser/loader/resource_request_info_impl.h",
    "+content/common/content_export.h",
  ],
  "resource_loader\.(cc|h)": [
    "-content",
    "+content/browser/loader/resource_controller.h",
    "+content/browser/loader/resource_handler.h",
    "+content/browser/loader/resource_loader.h",
    "+content/browser/loader/resource_loader_delegate.h",
    "+content/browser/loader/resource_request_info_impl.h",
    "+content/browser/ssl/ssl_client_auth_handler.h",
    "+content/browser/ssl/ssl_error_handler.h",
    "+content/common/content_export.h",
    "+content/public/browser/resource_dispatcher_host_login_delegate.h",
    "+content/public/common/browser_side_navigation_policy.h",
    "+content/public/common/previews_state.h",
    "+content/public/common/resource_response.h",
    "+content/public/common/resource_type.h",

    # TODO: these all have to be removed.
    "+content/browser/appcache/appcache_interceptor.h",
    "+content/browser/child_process_security_policy_impl.h",
    "+content/browser/loader/cross_site_resource_handler.h",
    "+content/browser/loader/detachable_resource_handler.h",
    "+content/browser/service_worker/service_worker_request_handler.h",
    "+content/browser/service_worker/service_worker_response_info.h",
    "+content/browser/ssl/ssl_manager.h",
    "+content/public/common/content_client.h",
    "+content/public/common/content_switches.h",
  ],
  "resource_handler_delegate\.h": [
    "-content",
  ],
  "resource_request_info_impl\.(cc|h)": [
    "-content",
    "+content/browser/loader/global_routing_id.h",
    "+content/browser/loader/resource_handler.h",
    "+content/browser/loader/resource_message_filter.h",
    "+content/browser/loader/resource_request_info_impl.h",
    "+content/browser/loader/resource_requester_info.h",
    "+content/common/content_export.h",
    "+content/common/resource_request_body_impl.h",
    "+content/common/url_loader.mojom.h",
    "+content/public/browser/global_request_id.h",
    "+content/public/browser/resource_request_info.h",
    "+content/public/common/previews_state.h",
    "+content/public/common/referrer.h",
    "+content/public/common/resource_type.h",

    # TODO: these all have to be removed.
    "+content/browser/frame_host/frame_tree_node.h",
    "+content/browser/web_contents/web_contents_impl.h",
    "+content/common/net/url_request_service_worker_data.h",
    "+content/common/net/url_request_user_data.h",
    "+content/public/browser/browser_thread.h",
    "+content/public/browser/navigation_ui_data.h",
    "+content/public/common/browser_side_navigation_policy.h",
    "+content/public/common/process_type.h",
  ],
  "resource_requester_info\.(cc|h)": [
    "-content",
    "+content/browser/loader/resource_requester_info.h",
    "+content/common/content_export.h",
    "+content/public/browser/resource_context.h",
    "+content/public/common/resource_type.h",

    # TODO: these all have to be removed.
    "+content/browser/appcache/chrome_appcache_service.h",
    "+content/browser/blob_storage/chrome_blob_storage_context.h",
    "+content/browser/service_worker/service_worker_context_wrapper.h",
    "+content/public/browser/browser_thread.h",
    "+content/public/common/browser_side_navigation_policy.h",
  ],
  "resource_scheduler\.(cc|h)": [
    "-content",
    "+content/browser/loader/resource_scheduler.h",
    "+content/common/content_export.h",
    "+content/public/browser/resource_controller.h",
    "+content/public/browser/resource_request_info.h",
    "+content/public/browser/resource_throttle.h",

    # TODO: To be replaced by mojo.
    "+content/common/resource_messages.h",
  ],
  "resource_scheduler_filter\.(cc|h)": [
    "-content",
    "+content/browser/loader/resource_dispatcher_host_impl.h",
    "+content/browser/loader/resource_scheduler.h",
    "+content/browser/loader/resource_scheduler_filter.h",

    # TODO: To be replaced by mojo.
    "+content/common/frame_messages.h",
    "+content/common/view_messages.h",
    "+content/public/browser/browser_message_filter.h",
  ],
  "sync_resource_handler\.(cc|h)": [
    "-content",
    "+content/browser/loader/netlog_observer.h",
    "+content/browser/loader/resource_dispatcher_host_impl.h",
    "+content/browser/loader/resource_handler.h",
    "+content/browser/loader/resource_request_info_impl.h",
    "+content/browser/loader/sync_resource_handler.h",
    "+content/public/browser/resource_dispatcher_host_delegate.h",
    "+content/public/browser/resource_request_info.h",
    "+content/public/common/resource_response.h",


    # TODO: To be replaced by mojo.
    "+content/common/resource_messages.h",
  ],
  "test_url_loader_client\.(cc|h)": [
    "-content",
    "+content/browser/loader/test_url_loader_client.h",
    "+content/common/resource_request_completion_status.h",
    "+content/common/url_loader.mojom.h",
    "+content/common/url_loader_factory.mojom.h",
    "+content/public/common/resource_response.h",
  ],
  "upload_progress_tracker\.(cc|h)": [
    "-content",
    "+content/browser/loader/upload_progress_tracker.h",
    "+content/common/content_export.h",
  ],
  "url_loader_factory_impl\.(cc|h)": [
    "-content",
    "+content/browser/loader/resource_dispatcher_host_impl.h",
    "+content/browser/loader/resource_requester_info.h",
    "+content/browser/loader/url_loader_factory_impl.h",
    "+content/common/content_export.h",
    "+content/common/resource_request.h",
    "+content/common/url_loader.mojom.h",
    "+content/common/url_loader_factory.mojom.h",
    "+content/public/browser/browser_thread.h",
  ],
  "url_loader_factory_impl_unittest\.cc": [
    "-content",
    "+content/browser/child_process_security_policy_impl.h",
    "+content/browser/loader/mojo_async_resource_handler.h",
    "+content/browser/loader/test_url_loader_client.h",
    "+content/browser/loader/resource_dispatcher_host_impl.h",
    "+content/browser/loader/resource_message_filter.h",
    "+content/browser/loader/resource_request_info_impl.h",
    "+content/browser/loader/url_loader_factory_impl.h",
    "+content/browser/loader_delegate_impl.h",
    "+content/common/resource_request.h",
    "+content/common/resource_request_completion_status.h",
    "+content/common/url_loader.mojom.h",
    "+content/common/url_loader_factory.mojom.h",
    "+content/public/browser/resource_context.h",
    "+content/public/browser/resource_dispatcher_host_delegate.h",
    "+content/public/common/content_paths.h",
    "+content/public/test/test_browser_context.h",
    "+content/public/test/test_browser_thread_bundle.h",

    #TODO: To be removed when PlzNavigate lands.
    "+content/browser/loader/navigation_resource_throttle.h"
  ],
}
